<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="resource/js/vue.js"></script>
</head>
<body>
<div id="demo">
    {{fullName}}
</div>
<script>
    var vm = new Vue({
        el: '#demo',
        data:{
            firstName: 'Foo',
            lastName: 'Bar',
            fullName: 'Foo Bar'
        }
    })
    vm.$watch('firstName', function(val){
        this.fullName = val + ' ' + this.lastName
    })
    vm.$watch('lastName', function(val){
        this.fullName = this.firstName + ' ' + val
    })

</script>
</body>
</html>

